from rest_framework import serializers
from rest_framework.generics import ListAPIView

from goods.models import SpecificationOption, SPUSpecification

class OptionSerializer(serializers.ModelSerializer):
    spec = serializers.StringRelatedField(read_only=True)
    spec_id = serializers.IntegerField()
    class Meta:
        model = SpecificationOption
        fields = '__all__'

class OptionSimpleSerializer(serializers.ModelSerializer):
    class Meta:
        model = SPUSpecification
        fields = '__all__'

